#include "MyArray.h"
#include <iostream>
using namespace std;

int main() {
	// 测试1：构造函数
	MyArray arr1(3, 2);  // 长度3，元素[2,2,2]
	MyArray arr2(2, 5);  // 长度2，元素[5,5]
	cout << "arr1: ";
	arr1.printArray();
	cout << "arr2: ";
	arr2.printArray();

	// 测试2：拷贝构造函数（深拷贝）
	MyArray arr3 = arr1;
	cout << "arr3（拷贝arr1）: ";
	arr3.printArray();

	// 测试3：数组合并
	MyArray arrMerge = arr1.merge(arr2);
	cout << "arr1合并arr2: ";
	arrMerge.printArray();

	// 测试4：四则运算
	MyArray arrAdd = arr1.add(arr2);
	cout << "arr1+arr2: ";
	arrAdd.printArray();

	MyArray arrSub = arr1.subtract(arr2);
	cout << "arr1-arr2: ";
	arrSub.printArray();

	MyArray arrMul = arr1.multiply(arr2);
	cout << "arr1*arr2: ";
	arrMul.printArray();

	MyArray arrDiv = arr1.divide(arr2);
	cout << "arr1/arr2: ";
	arrDiv.printArray();

	system("pause");
	return 0;
}